import BuffUtil from '@/BuffUtil';
import UnitSpellEvent from '@/event/UnitSpellEvent';
import Buff from '@/Buff';
export default class Item_莫尔迪基安的臂章 {
    static id = 'AIv1';
    static 名称: string = 'Item_莫尔迪基安的臂章';
    static 描述: string = '增加25点体质和力量，增加30攻速，但是每秒受到伤害';
    static 图标: string = 'ReplaceableTextures\\CommandButtons\\BTNImprovedUnholyStrength.blp';
    static buffId: string = 'buff_item_bizhang';
    static buffType: AppBuffType = {
        id: 'buff_item_bizhang',
        name: Item_莫尔迪基安的臂章.名称,
        ubertip: Item_莫尔迪基安的臂章.描述,
        art: Item_莫尔迪基安的臂章.图标,
        class: '光环',
        attribute: {
            strength: 25,
            agility: 25,
            attackSpd_p: 0.3,
        },
        interval: 0.5,
        onInterval: Item_莫尔迪基安的臂章.buffEffect,
        targetAttach: 'overhead',
        targetArt: '',
    };
    static buffEffect(buff: Buff) {
        let dmg = 12.5 + GetUnitState(buff.getParent(), UNIT_STATE_MAX_LIFE) * 0.0125;
        DamageSystemInstance.applyDarkDamage(buff.getParent(), buff.getCaster(), dmg);
    }
    static 添加技能(目标: unit) {
        UnitAddAbility(目标, Item_莫尔迪基安的臂章.id);
    }
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        if (BuffUtil.hasUnitBuff(来源, Item_莫尔迪基安的臂章.buffId, 来源)) {
            BuffUtil.clearUnitBuff(来源, Item_莫尔迪基安的臂章.buffId, 来源);
        } else {
            BuffUtil.addBuff(来源, Item_莫尔迪基安的臂章.buffId, 来源);
        }
    }
    constructor() {
        BuffUtil.registerBuffType(Item_莫尔迪基安的臂章.buffType);
        se.onUnitSpellEffect(Item_莫尔迪基安的臂章.spellEffect, Item_莫尔迪基安的臂章.id);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_莫尔迪基安的臂章.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
